<template>
    <view class="main">
        <z-paging ref="paging" v-model="dataList" @query="queryList">
            <view class="px-[30rpx] rounded-lg bg-white mb-[20rpx]">
                <view
                    class="item flex justify-between items-center"
                    v-for="(item, index) in dataList"
                    :key="index"
                >
                    <view class="py-[18rpx]">
                        <view class="text-lg">{{ item.action }}</view>
                        <view class="text-muted text-xs mt-[10rpx]">{{ item.updateTime }}</view>
                    </view>
                    <view class="text-xl" :class="{ 'text-[#FA8919]': item.actionType == 1 }">
                        {{ item.amount }}
                    </view>
                </view>
            </view>
        </z-paging>
    </view>
</template>
<script lang="ts" setup>
import { getSignInLogs } from '@/api/signIn'
import { ref } from 'vue'

const dataList: any = ref([])
const paging: any = ref(null)

const queryList = async (pageNo: any, pageSize: any) => {
    const { lists } = await getSignInLogs({ pageNo, pageSize })
    paging.value.complete(lists)
}
</script>
<style lang="scss" scoped>
.main {
    padding: 20rpx 20rpx 0 20rpx;
    height: calc(100vh - env(safe-area-inset-bottom));
    overflow: scroll;
}
.item {
    &:not(:last-child) {
        border-bottom: 1px solid #e5e5e5;
    }
}
</style>
